package com.huawei.appgallery.forum.message.card;

import android.content.Context;
import android.view.View;
import android.widget.TextView;
import com.huawei.appgallery.forum.base.card.ForumCard;
import com.huawei.appgallery.forum.base.card.bean.CommentReference;
import com.huawei.appgallery.forum.message.bean.ForumRemindEventCardBean;
import com.huawei.appgallery.forum.message.widget.CommentReferenceView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import o.azb;
import o.bsy.e;
import o.bvj.b;
import o.bvj.d;
import o.cgz;
import o.dof;

public class ForumRemindEventCard extends ForumCard {
    private View ˊ;
    private TextView ˋ;
    private View ˎ;
    private CommentReferenceView ˏ;

    public ForumRemindEventCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        ʽ(view);
        this.ˋ = (TextView) view.findViewById(b.ॱᐝ);
        this.ˏ = (CommentReferenceView) view.findViewById(b.ᐝॱ);
        this.ˎ = view.findViewById(b.ͺ);
        this.ˊ = view.findViewById(b.ॱ);
        this.ˊ.setVisibility(8);
        this.ˏ.setUserContentMaxWidth(((azb.ॱ(this.ʼॱ) - (this.ʼॱ.getResources().getDimensionPixelOffset(e.ʿ) * 2)) - (this.ʼॱ.getResources().getDimensionPixelOffset(e.ॱˎ) * 3)) - this.ʼॱ.getResources().getDimensionPixelOffset(e.ˉ));
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof ForumRemindEventCardBean) {
            ˎ((ForumRemindEventCardBean) cardBean);
            this.ˎ.setVisibility(ˊᐝ() ? 0 : 8);
        }
    }

    private void ˎ(ForumRemindEventCardBean forumRemindEventCardBean) {
        if (forumRemindEventCardBean.ˋॱ()) {
            this.ˊ.setVisibility(0);
        } else {
            this.ˊ.setVisibility(8);
        }
        if (dof.ʽ(forumRemindEventCardBean.ˊ())) {
            this.ˋ.setVisibility(8);
        } else {
            this.ˋ.setVisibility(0);
            this.ˋ.setText(forumRemindEventCardBean.ˊ());
        }
        CommentReference ᐝ = forumRemindEventCardBean.ᐝ();
        if (ᐝ != null) {
            this.ˏ.setVisibility(0);
            this.ˏ.setPostTitleWidth((azb.ॱ(this.ʼॱ) - this.ʼॱ.getResources().getDimensionPixelSize(d.ʼ)) - (this.ʼॱ.getResources().getDimensionPixelSize(d.ʽ) * 2));
            this.ˏ.setReference(ᐝ);
            this.ˏ.setDomainId(forumRemindEventCardBean.ॱ());
            return;
        }
        this.ˏ.setVisibility(8);
    }
}
